home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / HFSVolumes.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  19.3 KB  |  486 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        HFSVolumes.p
  3.  
  4.      Contains:    On-disk data structures for HFS and HFS Plus volumes.
  5.  
  6.      Version:    Technology:    
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1984-1998 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT HFSVolumes;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __HFSVOLUMES__}
  28. {$SETC __HFSVOLUMES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC HFSVolumesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __FILES__}
  38. {$I Files.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __FINDER__}
  41. {$I Finder.p}
  42. {$ENDC}
  43.  
  44.  
  45.  
  46. {$PUSH}
  47. {$ALIGN MAC68K}
  48. {$LibExport+}
  49.  
  50. { Signatures used to differentiate between HFS and HFS Plus volumes }
  51.  
  52. CONST
  53.     kHFSSigWord                    = $4244;                        {  'BD' in ASCII  }
  54.     kHFSPlusSigWord                = $482B;                        {  'H+' in ASCII  }
  55.     kHFSPlusVersion                = $0004;                        {  will change as format changes (version 4 shipped with Mac OS 8.1)  }
  56.     kHFSPlusMountVersion        = '8.10';                        {  will change as implementations change ('8.10' in Mac OS 8.1)  }
  57.  
  58.  
  59. { CatalogNodeID is used to track catalog objects }
  60.  
  61. TYPE
  62.     HFSCatalogNodeID                    = UInt32;
  63. { Unicode strings are used for file and folder names (HFS Plus only) }
  64.     HFSUniStr255Ptr = ^HFSUniStr255;
  65.     HFSUniStr255 = RECORD
  66.         length:                    UInt16;                                    {  number of unicode characters  }
  67.         unicode:                ARRAY [0..254] OF UniChar;                {  unicode characters  }
  68.     END;
  69.  
  70.     ConstHFSUniStr255Param                = ^HFSUniStr255;
  71.  
  72. CONST
  73.     kHFSMaxVolumeNameChars        = 27;
  74.     kHFSMaxFileNameChars        = 31;
  75.     kHFSPlusMaxFileNameChars    = 255;
  76.  
  77.  
  78. { Extent overflow file data structures }
  79. { HFS Extent key }
  80.  
  81. TYPE
  82.     HFSExtentKeyPtr = ^HFSExtentKey;
  83.     HFSExtentKey = RECORD
  84.         keyLength:                SInt8;                                    {  length of key, excluding this field  }
  85.         forkType:                SInt8;                                    {  0 = data fork, FF = resource fork  }
  86.         fileID:                    HFSCatalogNodeID;                        {  file ID  }
  87.         startBlock:                UInt16;                                    {  first file allocation block number in this extent  }
  88.     END;
  89.  
  90. { HFS Plus Extent key }
  91.     HFSPlusExtentKeyPtr = ^HFSPlusExtentKey;
  92.     HFSPlusExtentKey = RECORD
  93.         keyLength:                UInt16;                                    {  length of key, excluding this field  }
  94.         forkType:                SInt8;                                    {  0 = data fork, FF = resource fork  }
  95.         pad:                    SInt8;                                    {  make the other fields align on 32-bit boundary  }
  96.         fileID:                    HFSCatalogNodeID;                        {  file ID  }
  97.         startBlock:                UInt32;                                    {  first file allocation block number in this extent  }
  98.     END;
  99.  
  100. { Number of extent descriptors per extent record }
  101.  
  102. CONST
  103.     kHFSExtentDensity            = 3;
  104.     kHFSPlusExtentDensity        = 8;
  105.  
  106. { HFS extent descriptor }
  107.  
  108. TYPE
  109.     HFSExtentDescriptorPtr = ^HFSExtentDescriptor;
  110.     HFSExtentDescriptor = RECORD
  111.         startBlock:                UInt16;                                    {  first allocation block  }
  112.         blockCount:                UInt16;                                    {  number of allocation blocks  }
  113.     END;
  114.  
  115. { HFS Plus extent descriptor }
  116.     HFSPlusExtentDescriptorPtr = ^HFSPlusExtentDescriptor;
  117.     HFSPlusExtentDescriptor = RECORD
  118.         startBlock:                UInt32;                                    {  first allocation block  }
  119.         blockCount:                UInt32;                                    {  number of allocation blocks  }
  120.     END;
  121.  
  122. { HFS extent record }
  123.     HFSExtentRecord                        = ARRAY [0..2] OF HFSExtentDescriptor;
  124. { HFS Plus extent record }
  125.     HFSPlusExtentRecord                    = ARRAY [0..7] OF HFSPlusExtentDescriptor;
  126.  
  127. { Fork data info (HFS Plus only) - 80 bytes }
  128.     HFSPlusForkDataPtr = ^HFSPlusForkData;
  129.     HFSPlusForkData = RECORD
  130.         logicalSize:            UInt64;                                    {  fork's logical size in bytes  }
  131.         clumpSize:                UInt32;                                    {  fork's clump size in bytes  }
  132.         totalBlocks:            UInt32;                                    {  total blocks used by this fork  }
  133.         extents:                HFSPlusExtentRecord;                    {  initial set of extents  }
  134.     END;
  135.  
  136. { Permissions info (HFS Plus only) - 16 bytes }
  137.     HFSPlusPermissionsPtr = ^HFSPlusPermissions;
  138.     HFSPlusPermissions = RECORD
  139.         ownerID:                UInt32;                                    {  user or group ID of file/folder owner  }
  140.         groupID:                UInt32;                                    {  additional user of group ID  }
  141.         permissions:            UInt32;                                    {  permissions (bytes: unused, owner, group, everyone)  }
  142.         specialDevice:            UInt32;                                    {  UNIX: device for character or block special file  }
  143.     END;
  144.  
  145. { Catalog file data structures }
  146.  
  147. CONST
  148.     kHFSRootParentID            = 1;                            {  Parent ID of the root folder  }
  149.     kHFSRootFolderID            = 2;                            {  Folder ID of the root folder  }
  150.     kHFSExtentsFileID            = 3;                            {  File ID of the extents file  }
  151.     kHFSCatalogFileID            = 4;                            {  File ID of the catalog file  }
  152.     kHFSBadBlockFileID            = 5;                            {  File ID of the bad allocation block file  }
  153.     kHFSAllocationFileID        = 6;                            {  File ID of the allocation file (HFS Plus only)  }
  154.     kHFSStartupFileID            = 7;                            {  File ID of the startup file (HFS Plus only)  }
  155.     kHFSAttributesFileID        = 8;                            {  File ID of the attribute file (HFS Plus only)  }
  156.     kHFSBogusExtentFileID        = 15;                            {  Used for exchanging extents in extents file  }
  157.     kHFSFirstUserCatalogNodeID    = 16;
  158.  
  159.  
  160. { HFS catalog key }
  161.  
  162. TYPE
  163.     HFSCatalogKeyPtr = ^HFSCatalogKey;
  164.     HFSCatalogKey = RECORD
  165.         keyLength:                SInt8;                                    {  key length (in bytes)  }
  166.         reserved:                SInt8;                                    {  reserved (set to zero)  }
  167.         parentID:                HFSCatalogNodeID;                        {  parent folder ID  }
  168.         nodeName:                Str31;                                    {  catalog node name  }
  169.     END;
  170.  
  171. { HFS Plus catalog key }
  172.     HFSPlusCatalogKeyPtr = ^HFSPlusCatalogKey;
  173.     HFSPlusCatalogKey = RECORD
  174.         keyLength:                UInt16;                                    {  key length (in bytes)  }
  175.         parentID:                HFSCatalogNodeID;                        {  parent folder ID  }
  176.         nodeName:                HFSUniStr255;                            {  catalog node name  }
  177.     END;
  178.  
  179.  
  180. { Catalog record types }
  181.  
  182. CONST
  183.                                                                 {  HFS Catalog Records  }
  184.     kHFSFolderRecord            = $0100;                        {  Folder record  }
  185.     kHFSFileRecord                = $0200;                        {  File record  }
  186.     kHFSFolderThreadRecord        = $0300;                        {  Folder thread record  }
  187.     kHFSFileThreadRecord        = $0400;                        {  File thread record  }
  188.                                                                 {  HFS Plus Catalog Records  }
  189.     kHFSPlusFolderRecord        = 1;                            {  Folder record  }
  190.     kHFSPlusFileRecord            = 2;                            {  File record  }
  191.     kHFSPlusFolderThreadRecord    = 3;                            {  Folder thread record  }
  192.     kHFSPlusFileThreadRecord    = 4;                            {  File thread record  }
  193.  
  194.  
  195. { Catalog file record flags }
  196.     kHFSFileLockedBit            = $0000;                        {  file is locked and cannot be written to  }
  197.     kHFSFileLockedMask            = $0001;
  198.     kHFSThreadExistsBit            = $0001;                        {  a file thread record exists for this file  }
  199.     kHFSThreadExistsMask        = $0002;
  200.  
  201.  
  202. { HFS catalog folder record - 70 bytes }
  203.  
  204. TYPE
  205.     HFSCatalogFolderPtr = ^HFSCatalogFolder;
  206.     HFSCatalogFolder = RECORD
  207.         recordType:                SInt16;                                    {  record type  }
  208.         flags:                    UInt16;                                    {  folder flags  }
  209.         valence:                UInt16;                                    {  folder valence  }
  210.         folderID:                HFSCatalogNodeID;                        {  folder ID  }
  211.         createDate:                UInt32;                                    {  date and time of creation  }
  212.         modifyDate:                UInt32;                                    {  date and time of last modification  }
  213.         backupDate:                UInt32;                                    {  date and time of last backup  }
  214.         userInfo:                DInfo;                                    {  Finder information  }
  215.         finderInfo:                DXInfo;                                    {  additional Finder information  }
  216.         reserved:                ARRAY [0..3] OF UInt32;                    {  reserved - set to zero  }
  217.     END;
  218.  
  219. { HFS Plus catalog folder record - 88 bytes }
  220.     HFSPlusCatalogFolderPtr = ^HFSPlusCatalogFolder;
  221.     HFSPlusCatalogFolder = RECORD
  222.         recordType:                SInt16;                                    {  record type = HFS Plus folder record  }
  223.         flags:                    UInt16;                                    {  file flags  }
  224.         valence:                UInt32;                                    {  folder's valence (limited to 2^16 in Mac OS)  }
  225.         folderID:                HFSCatalogNodeID;                        {  folder ID  }
  226.         createDate:                UInt32;                                    {  date and time of creation  }
  227.         contentModDate:            UInt32;                                    {  date and time of last content modification  }
  228.         attributeModDate:        UInt32;                                    {  date and time of last attribute modification  }
  229.         accessDate:                UInt32;                                    {  date and time of last access (Rhapsody only)  }
  230.         backupDate:                UInt32;                                    {  date and time of last backup  }
  231.         permissions:            HFSPlusPermissions;                        {  permissions (for Rhapsody)  }
  232.         userInfo:                DInfo;                                    {  Finder information  }
  233.         finderInfo:                DXInfo;                                    {  additional Finder information  }
  234.         textEncoding:            UInt32;                                    {  hint for name conversions  }
  235.         reserved:                UInt32;                                    {  reserved - set to zero  }
  236.     END;
  237.  
  238. { HFS catalog file record - 102 bytes }
  239.     HFSCatalogFilePtr = ^HFSCatalogFile;
  240.     HFSCatalogFile = RECORD
  241.         recordType:                SInt16;                                    {  record type  }
  242.         flags:                    SInt8;                                    {  file flags  }
  243.         fileType:                SInt8;                                    {  file type (unused ?)  }
  244.         userInfo:                FInfo;                                    {  Finder information  }
  245.         fileID:                    HFSCatalogNodeID;                        {  file ID  }
  246.         dataStartBlock:            UInt16;                                    {  not used - set to zero  }
  247.         dataLogicalSize:        SInt32;                                    {  logical EOF of data fork  }
  248.         dataPhysicalSize:        SInt32;                                    {  physical EOF of data fork  }
  249.         rsrcStartBlock:            UInt16;                                    {  not used - set to zero  }
  250.         rsrcLogicalSize:        SInt32;                                    {  logical EOF of resource fork  }
  251.         rsrcPhysicalSize:        SInt32;                                    {  physical EOF of resource fork  }
  252.         createDate:                UInt32;                                    {  date and time of creation  }
  253.         modifyDate:                UInt32;                                    {  date and time of last modification  }
  254.         backupDate:                UInt32;                                    {  date and time of last backup  }
  255.         finderInfo:                FXInfo;                                    {  additional Finder information  }
  256.         clumpSize:                UInt16;                                    {  file clump size (not used)  }
  257.         dataExtents:            HFSExtentRecord;                        {  first data fork extent record  }
  258.         rsrcExtents:            HFSExtentRecord;                        {  first resource fork extent record  }
  259.         reserved:                UInt32;                                    {  reserved - set to zero  }
  260.     END;
  261.  
  262. { HFS Plus catalog file record - 248 bytes }
  263.     HFSPlusCatalogFilePtr = ^HFSPlusCatalogFile;
  264.     HFSPlusCatalogFile = RECORD
  265.         recordType:                SInt16;                                    {  record type = HFS Plus file record  }
  266.         flags:                    UInt16;                                    {  file flags  }
  267.         reserved1:                UInt32;                                    {  reserved - set to zero  }
  268.         fileID:                    HFSCatalogNodeID;                        {  file ID  }
  269.         createDate:                UInt32;                                    {  date and time of creation  }
  270.         contentModDate:            UInt32;                                    {  date and time of last content modification  }
  271.         attributeModDate:        UInt32;                                    {  date and time of last attribute modification  }
  272.         accessDate:                UInt32;                                    {  date and time of last access (Rhapsody only)  }
  273.         backupDate:                UInt32;                                    {  date and time of last backup  }
  274.         permissions:            HFSPlusPermissions;                        {  permissions (for Rhapsody)  }
  275.         userInfo:                FInfo;                                    {  Finder information  }
  276.         finderInfo:                FXInfo;                                    {  additional Finder information  }
  277.         textEncoding:            UInt32;                                    {  hint for name conversions  }
  278.         reserved2:                UInt32;                                    {  reserved - set to zero  }
  279.                                                                         {  start on double long (64 bit) boundry  }
  280.         dataFork:                HFSPlusForkData;                        {  size and block data for data fork  }
  281.         resourceFork:            HFSPlusForkData;                        {  size and block data for resource fork  }
  282.     END;
  283.  
  284. { HFS catalog thread record - 46 bytes }
  285.     HFSCatalogThreadPtr = ^HFSCatalogThread;
  286.     HFSCatalogThread = RECORD
  287.         recordType:                SInt16;                                    {  record type  }
  288.         reserved:                ARRAY [0..1] OF SInt32;                    {  reserved - set to zero  }
  289.         parentID:                HFSCatalogNodeID;                        {  parent ID for this catalog node  }
  290.         nodeName:                Str31;                                    {  name of this catalog node  }
  291.     END;
  292.  
  293. { HFS Plus catalog thread record -- 264 bytes }
  294.     HFSPlusCatalogThreadPtr = ^HFSPlusCatalogThread;
  295.     HFSPlusCatalogThread = RECORD
  296.         recordType:                SInt16;                                    {  record type  }
  297.         reserved:                SInt16;                                    {  reserved - set to zero  }
  298.         parentID:                HFSCatalogNodeID;                        {  parent ID for this catalog node  }
  299.         nodeName:                HFSUniStr255;                            {  name of this catalog node (variable length)  }
  300.     END;
  301.  
  302.  
  303. {
  304.       These are the types of records in the attribute B-tree.  The values were chosen
  305.       so that they wouldn't conflict with the catalog record types.
  306. }
  307.  
  308. CONST
  309.     kHFSPlusAttrInlineData        = $10;                            {  if size <  kAttrOverflowSize  }
  310.     kHFSPlusAttrForkData        = $20;                            {  if size >= kAttrOverflowSize  }
  311.     kHFSPlusAttrExtents            = $30;                            {  overflow extents for large attributes  }
  312.  
  313.  
  314. {
  315.       HFSPlusAttrInlineData
  316.       For small attributes, whose entire value is stored within this one
  317.       B-tree record.
  318.       There would not be any other records for this attribute.
  319. }
  320.  
  321. TYPE
  322.     HFSPlusAttrInlineDataPtr = ^HFSPlusAttrInlineData;
  323.     HFSPlusAttrInlineData = RECORD
  324.         recordType:                UInt32;                                    {     = kHFSPlusAttrInlineData }
  325.         reserved:                UInt32;
  326.         logicalSize:            UInt32;                                    {     size in bytes of userData }
  327.         userData:                PACKED ARRAY [0..1] OF Byte;            {     variable length; space allocated is a multiple of 2 bytes }
  328.     END;
  329.  
  330. {
  331.       HFSPlusAttrForkData
  332.       For larger attributes, whose value is stored in allocation blocks.
  333.       If the attribute has more than 8 extents, there will be additonal
  334.       records (of type HFSPlusAttrExtents) for this attribute.
  335. }
  336.     HFSPlusAttrForkDataPtr = ^HFSPlusAttrForkData;
  337.     HFSPlusAttrForkData = RECORD
  338.         recordType:                UInt32;                                    {     = kHFSPlusAttrForkData }
  339.         reserved:                UInt32;
  340.         theFork:                HFSPlusForkData;                        {     size and first extents of value }
  341.     END;
  342.  
  343. {
  344.       HFSPlusAttrExtents
  345.       This record contains information about overflow extents for large,
  346.       fragmented attributes.
  347. }
  348.     HFSPlusAttrExtentsPtr = ^HFSPlusAttrExtents;
  349.     HFSPlusAttrExtents = RECORD
  350.         recordType:                UInt32;                                    {     = kHFSPlusAttrExtents }
  351.         reserved:                UInt32;
  352.         extents:                HFSPlusExtentRecord;                    {     additional extents }
  353.     END;
  354.  
  355. {     A generic Attribute Record }
  356.     HFSPlusAttrRecordPtr = ^HFSPlusAttrRecord;
  357.     HFSPlusAttrRecord = RECORD
  358.         CASE INTEGER OF
  359.         0: (
  360.             recordType:            UInt32;
  361.             );
  362.         1: (
  363.             inlineData:            HFSPlusAttrInlineData;
  364.             );
  365.         2: (
  366.             forkData:            HFSPlusAttrForkData;
  367.             );
  368.         3: (
  369.             overflowExtents:    HFSPlusAttrExtents;
  370.             );
  371.     END;
  372.  
  373. { Key and node lengths }
  374.  
  375. CONST
  376.     kHFSPlusExtentKeyMaximumLength = 10;
  377.     kHFSExtentKeyMaximumLength    = 7;
  378.     kHFSPlusCatalogKeyMaximumLength = 516;
  379.     kHFSPlusCatalogKeyMinimumLength = 6;
  380.     kHFSCatalogKeyMaximumLength    = 37;
  381.     kHFSCatalogKeyMinimumLength    = 6;
  382.     kHFSPlusCatalogMinNodeSize    = 4096;
  383.     kHFSPlusExtentMinNodeSize    = 512;
  384.     kHFSPlusAttrMinNodeSize        = 4096;
  385.  
  386.  
  387. { HFS and HFS Plus volume attribute bits }
  388.                                                                 {  Bits 0-6 are reserved (always cleared by MountVol call)  }
  389.     kHFSVolumeHardwareLockBit    = 7;                            {  volume is locked by hardware  }
  390.     kHFSVolumeUnmountedBit        = 8;                            {  volume was successfully unmounted  }
  391.     kHFSVolumeSparedBlocksBit    = 9;                            {  volume has bad blocks spared  }
  392.     kHFSVolumeNoCacheRequiredBit = 10;                            {  don't cache volume blocks (i.e. RAM or ROM disk)  }
  393.     kHFSBootVolumeInconsistentBit = 11;                            {  boot volume is inconsistent (System 7.6 and later)  }
  394.                                                                 {  Bits 12-14 are reserved for future use  }
  395.     kHFSVolumeSoftwareLockBit    = 15;                            {  volume is locked by software  }
  396.     kHFSVolumeHardwareLockMask    = $80;
  397.     kHFSVolumeUnmountedMask        = $0100;
  398.     kHFSVolumeSparedBlocksMask    = $0200;
  399.     kHFSVolumeNoCacheRequiredMask = $0400;
  400.     kHFSBootVolumeInconsistentMask = $0800;
  401.     kHFSVolumeSoftwareLockMask    = $8000;
  402.     kHFSMDBAttributesMask        = $8380;
  403.  
  404.  
  405. { Master Directory Block (HFS only) - 162 bytes }
  406. { Stored at sector #2 (3rd sector) }
  407.  
  408. TYPE
  409.     HFSMasterDirectoryBlockPtr = ^HFSMasterDirectoryBlock;
  410.     HFSMasterDirectoryBlock = RECORD
  411.                                                                         {  These first fields are also used by MFS  }
  412.         drSigWord:                UInt16;                                    {  volume signature  }
  413.         drCrDate:                UInt32;                                    {  date and time of volume creation  }
  414.         drLsMod:                UInt32;                                    {  date and time of last modification  }
  415.         drAtrb:                    UInt16;                                    {  volume attributes  }
  416.         drNmFls:                SInt16;                                    {  number of files in root folder  }
  417.         drVBMSt:                UInt16;                                    {  first block of volume bitmap  }
  418.         drAllocPtr:                UInt16;                                    {  start of next allocation search  }
  419.         drNmAlBlks:                UInt16;                                    {  number of allocation blocks in volume  }
  420.         drAlBlkSiz:                SInt32;                                    {  size (in bytes) of allocation blocks  }
  421.         drClpSiz:                SInt32;                                    {  default clump size  }
  422.         drAlBlSt:                SInt16;                                    {  first allocation block in volume  }
  423.         drNxtCNID:                UInt32;                                    {  next unused catalog node ID  }
  424.         drFreeBks:                SInt16;                                    {  number of unused allocation blocks  }
  425.         drVN:                    Str27;                                    {  volume name  }
  426.                                                                         {  Master Directory Block extensions for HFS  }
  427.         drVolBkUp:                UInt32;                                    {  date and time of last backup  }
  428.         drVSeqNum:                UInt16;                                    {  volume backup sequence number  }
  429.         drWrCnt:                SInt32;                                    {  volume write count  }
  430.         drXTClpSiz:                SInt32;                                    {  clump size for extents overflow file  }
  431.         drCTClpSiz:                SInt32;                                    {  clump size for catalog file  }
  432.         drNmRtDirs:                SInt16;                                    {  number of directories in root folder  }
  433.         drFilCnt:                SInt32;                                    {  number of files in volume  }
  434.         drDirCnt:                SInt32;                                    {  number of directories in volume  }
  435.         drFndrInfo:                ARRAY [0..7] OF SInt32;                    {  information used by the Finder  }
  436.         drEmbedSigWord:            UInt16;                                    {  embedded volume signature (formerly drVCSize)  }
  437.         drEmbedExtent:            HFSExtentDescriptor;                    {  embedded volume location and size (formerly drVBMCSize and drCtlCSize)  }
  438.         drXTFlSize:                SInt32;                                    {  size of extents overflow file  }
  439.         drXTExtRec:                HFSExtentRecord;                        {  extent record for extents overflow file  }
  440.         drCTFlSize:                SInt32;                                    {  size of catalog file  }
  441.         drCTExtRec:                HFSExtentRecord;                        {  extent record for catalog file  }
  442.     END;
  443.  
  444. { HFSPlusVolumeHeader (HFS Plus only) - 512 bytes }
  445. { Stored at sector #0 (1st sector) and last sector }
  446.     HFSPlusVolumeHeaderPtr = ^HFSPlusVolumeHeader;
  447.     HFSPlusVolumeHeader = RECORD
  448.         signature:                UInt16;                                    {  volume signature == 'H+'  }
  449.         version:                UInt16;                                    {  current version is kHFSPlusVersion  }
  450.         attributes:                UInt32;                                    {  volume attributes  }
  451.         lastMountedVersion:        UInt32;                                    {  implementation version which last mounted volume  }
  452.         reserved:                UInt32;                                    {  reserved - set to zero  }
  453.         createDate:                UInt32;                                    {  date and time of volume creation  }
  454.         modifyDate:                UInt32;                                    {  date and time of last modification  }
  455.         backupDate:                UInt32;                                    {  date and time of last backup  }
  456.         checkedDate:            UInt32;                                    {  date and time of last disk check  }
  457.         fileCount:                UInt32;                                    {  number of files in volume  }
  458.         folderCount:            UInt32;                                    {  number of directories in volume  }
  459.         blockSize:                UInt32;                                    {  size (in bytes) of allocation blocks  }
  460.         totalBlocks:            UInt32;                                    {  number of allocation blocks in volume (includes this header and VBM }
  461.         freeBlocks:                UInt32;                                    {  number of unused allocation blocks  }
  462.         nextAllocation:            UInt32;                                    {  start of next allocation search  }
  463.         rsrcClumpSize:            UInt32;                                    {  default resource fork clump size  }
  464.         dataClumpSize:            UInt32;                                    {  default data fork clump size  }
  465.         nextCatalogID:            HFSCatalogNodeID;                        {  next unused catalog node ID  }
  466.         writeCount:                UInt32;                                    {  volume write count  }
  467.         encodingsBitmap:        UInt64;                                    {  which encodings have been use  on this volume  }
  468.         finderInfo:                PACKED ARRAY [0..31] OF UInt8;            {  information used by the Finder  }
  469.         allocationFile:            HFSPlusForkData;                        {  allocation bitmap file  }
  470.         extentsFile:            HFSPlusForkData;                        {  extents B-tree file  }
  471.         catalogFile:            HFSPlusForkData;                        {  catalog B-tree file  }
  472.         attributesFile:            HFSPlusForkData;                        {  extended attributes B-tree file  }
  473.         startupFile:            HFSPlusForkData;                        {  boot file  }
  474.     END;
  475.  
  476. {$ALIGN RESET}
  477. {$POP}
  478.  
  479. {$SETC UsingIncludes := HFSVolumesIncludes}
  480.  
  481. {$ENDC} {__HFSVOLUMES__}
  482.  
  483. {$IFC NOT UsingIncludes}
  484.  END.
  485. {$ENDC}
  486.